package com.brainhealth.customer.service;

import java.util.List;

import com.brainhealth.customer.domain.BuriedPointQuery;
import com.brainhealth.customer.domain.Customer;
import com.brainhealth.customer.domain.InitUserParam;
import com.brainhealth.customer.domain.vo.CustomerScheduleVO;

import javax.servlet.http.HttpServletRequest;

/**
 * 会员信息Service接口
 * 
 * @author wolong
 * @date 2023-04-27
 */
public interface ICustomerService 
{
    /**
     * 查询会员信息
     * 
     * @param customerId 会员信息主键
     * @return 会员信息
     */
    public Customer selectCustomerByCustomerId(Long customerId);

    /**
     * 查询会员信息
     * @param customerIds 会员信息主键数组
     * @return 会员信息集合
     */
     List<Customer> selectCustomerByCustomerIds(List<Long> customerIds);

    /**
     * 查询会员信息列表
     * 
     * @param customer 会员信息
     * @return 会员信息集合
     */
    public List<Customer> selectCustomerList(Customer customer);


    /**
     * 根据机构ID，开始时间和结束时间获取会员订单关联信息
     * @param buriedPointQuery
     * @return
     */
    List<Customer> selectCustomerOrderList(BuriedPointQuery buriedPointQuery);

    /**
     * 新增会员信息
     * 
     * @param customer 会员信息
     * @return 结果
     */
    public int insertCustomer(Customer customer);

    /**
     * 添加白名单用户
     * @param phone
     * @return
     */
    public int addWhiteListCustomer(String phone);

    /**
     * 添加 5天体验会员用户
     * @return
     */
    public String addExperienceCustomer(String inviteCustomerId,String phone, String smsCode);

    /**
     * 初始化体验用户
     * @param phone
     * @return
     */
    public boolean initExperience(String phone);

    /**
     * 重置体验会员的状态和订单状态
     */
    public void resetExperienceCustomer();

    /**
     * 修改会员信息
     * 
     * @param customer 会员信息
     * @return 结果
     */
    public int updateCustomer(Customer customer);

    /**
     * 初始化用户为普通用户
     * @return
     */
    public int initNomalCustomer(Long customerId);

    /**
     * 添加会员黑名单
     * @param customer
     * @return
     */
    public boolean addCustomerBlack(Customer customer);

    /**
     * 修改会员注册手机号
     * @return
     */
    public boolean modifyCustomerPhone(String oldPhone, String newPhone);

    /**
     * 批量删除会员信息
     * 
     * @param customerIds 需要删除的会员信息主键集合
     * @return 结果
     */
    public int deleteCustomerByCustomerIds(Long[] customerIds);

    /**
     * 删除会员信息信息
     * 
     * @param customerId 会员信息主键
     * @return 结果
     */
    public int deleteCustomerByCustomerId(Long customerId);

    /**
     * 调用发送短信验证码的方法
     * @return
     */
    public boolean SendSmsCode(String phone);

    public boolean SendSmsCodeTest(String phone);

    /**
     * 手机验证码登录
     * @param phone 手机号
     * @param smsCode 短信验证码
     * @return
     */
    public String customerLogin(String phone, String smsCode);

    /**
     * 初始化用户
     * @param initUserParam
     * @return
     */
    Integer initCustomer(InitUserParam initUserParam);

    /**
     * 会员重新登录清理缓存
     * @param request
     * @return
     */
    public boolean customerLoginOut(HttpServletRequest request);

    /**
     * 手机和验证码注册
     * @param phone 手机号
     * @param smsCode 验证码
     * @return
     */
    public String customerRegister(String ip, String phone, String smsCode, String mechanismId);

    /**
     * 更新会员信息并刷新缓存
     * @param customer
     * @return
     */
    public boolean updateCustomerInfo(Customer customer);

    /**
     * 根据会员token获取会员信息
     * @param request
     * @return
     */
    public Customer getCustomerInfo(HttpServletRequest request);

    /**
     * 会员信息签到
     * @param request
     * @return
     */
    public boolean customerSignIn(HttpServletRequest request);

    /**
     * 获取会员训练日程信息
     * @param request
     * @return
     */
    public CustomerScheduleVO getCustomerScheduleInfo(HttpServletRequest request);

    /**
     * 生成用户分享连接
     * @return
     */
    public String createCustomerShareLink(HttpServletRequest request);

    /**
     * 刷新会员token信息
     * @param customer
     * @return
     */
    String refreshCustomerToken(Customer customer);

    /**
     * 刷新token
     * @param ts
     * @param customer
     * @return
     */
    String refreshToken(Long ts,Customer customer);
}
